package cn.xiaomubiao.oschine.activity;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SearchView;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cn.xiaomubiao.oschine.R;
import cn.xiaomubiao.oschine.bean.FindUserList;
import cn.xiaomubiao.oschine.util.HttpUtil;

/**
 * Created by King Su on 2017/4/2.
 */

public class FindUserActivity extends Activity {
    @BindView(R.id.iv_find_back)
    ImageView mIvFindBack;
    @BindView(R.id.sv_find)
    SearchView mSvFind;
    @BindView(R.id.rv_user)
    RecyclerView mRvUser;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_findfriends);
        ButterKnife.bind(this);

        initEvent();
    }

    private void initEvent() {
        mSvFind.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
            @Override
            public boolean onQueryTextSubmit(String query) {
                return false;
            }


            @Override
            public boolean onQueryTextChange(String newText) {
                if(TextUtils.isEmpty(newText))
                {
                    //如果文本框为空，那么将消失Recyclerview
                    mRvUser.setVisibility(View.GONE);
                }
                else
                {

                }
                return true;
            }
        });

        HttpUtil<FindUserList> httpUtil = new HttpUtil<>(getApplicationContext(),FindUserList.class);
        String url ="";
        //httpUtil.getStringData();
    }

    @OnClick(R.id.iv_find_back)
    public void onViewClicked() {
        FindUserActivity.this.finish();
    }
}
